﻿using System.Text;
/// <summary>
/// Excel有Office和Wps目前只支持Office后期加入Wps支持。
/// </summary>
namespace SUNRPA.CONTROLS.IMPL.domain.flowItemParam {
    [Serializable]
    public class IFNParam:BaseParam {
        //0与，1或
        private int conRelation = 0;
        private List<IFCondition> conditions = new List<IFCondition>();

        public int ConRelation {
            get => conRelation;
            set { 
                conRelation = value;
                this.NotifyPropertyChanged("ConRelation");
            }  
        } 
        public List<IFCondition> Conditions {
            get => conditions; 
            set { 
                conditions = value;
            }  
        }
        public string GetTranslateConditions() {
            StringBuilder sb = new StringBuilder();
            if(this.conRelation == 0) { 
                sb.Append("满足全部条件");
            } else { 
                sb.Append("满足任意条件");
            }
            foreach(IFCondition con in conditions) { 
                sb.Append($"{con.Con1}{IFCondition.relationAndName[con.ConRelation]}{con.Con2};");
            }
            return sb.ToString();
        }
    }

}
